<%= render_partial 'header' %>
    
<div class="maintime">
The time now is <%= Time.now.strftime('%b %d, %Y %I:%M %p') %>
</div>
	
<%= render_partial 'breadcrumbs' %>

<div class="forums">
    <% for forum in @forums %>
    <div class="forum">
        <div class="forum-name">
            <h2><%= link_to h(forum.name), :action => 'show', :id => forum %></h2>
        </div>
	   <div class="forum-description"><%=h forum.description %></div>
       <div class="forum-topics">
         <span class="forum-topics-header">Topics</span>
         <%=h forum.topics.size %>
       </div>
	   <div class="forum-posts">
	       <span class="forum-posts-header">Posts</span>
    	   <%=h forum.num_posts %>
       </div>
	   <div class="forum-last">
	       <% latest_topic = forum.latest_topic%>
   	       <% if latest_topic %>
    	       <% latest_post = latest_topic.latest_post %>
               <% latest_user = latest_post.user %>    	   
    	       <%=h latest_post.created_at.strftime('%b %d, %Y %I:%M %p') %>
    	       <span class="forum-last-author">
                   <%= link_to latest_user.login, :controller => 'profile', :action => 'show', :id => latest_user.profile %>
               </span>
               <span class="forum-last-link">
                   <%= link_to '>', :controller => 'topic', :action => 'show', :id => forum.latest_topic %>
               </span>
    	   <% end %>
        </div>
    </div>
    <% end %>
</div>